import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 菜单列表查询 */
export const getMenuList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/menu/page"), {
    params: filerEmptyVal(params)
  });
};

/** 新增菜单、按钮 */
export const addMenu = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/menu/add"), { data });
};

/** 修改菜单、按钮 */
export const upMenu = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/menu/update"), { data });
};

/** 删除菜单、按钮 */
export const delMenu = (treeId?: number) => {
  return http.request<any>("post", baseUrlApi("/menu/delete?id=" + treeId));
};
